package com.yasin.user.dubbo;

import com.yasin.user.api.UserDubboService;
import com.yasin.user.entity.User;
import com.yasin.user.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by Yasin H on 2017/5/19.
 */
@Service
public class UserDubboServiceImpl implements UserDubboService {

    private static Logger log = LoggerFactory.getLogger(UserDubboServiceImpl.class);

    @Resource
    private UserService userService;

    @Override
    public User getUserById(Integer id) {

        log.info("这是UserDubboService在调用getUserById方法...");

        return userService.selectUserById(id);
    }

    @Override
    public int saveUser(User user) {

        log.info("这是UserDubboService在调用saveUser方法...");

        return userService.insertUser(user);
    }
}
